﻿<Window x:Class="Menafrinet.View.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:Menafrinet.ViewModel;assembly=Menafrinet.ViewModel"
        xmlns:controls="clr-namespace:Menafrinet.View.Controls"
        xmlns:p="clr-namespace:Menafrinet.View.Properties"
        xmlns:local="clr-namespace:Menafrinet.View"
        Loaded="Window_Loaded"
        SizeChanged="Window_SizeChanged"
        Closing="Window_Closing"
        Title="{Binding Source={x:Static p:Settings.Default}, Path=ApplicationName, Mode=OneWay}" MinHeight="600" MinWidth="800" Height="{Binding Source={x:Static p:Settings.Default}, Path=WindowHeight, Mode=TwoWay}" Width="{Binding Source={x:Static p:Settings.Default}, Path=WindowWidth, Mode=TwoWay}" WindowState="{Binding Source={x:Static p:Settings.Default}, Path=WindowState, Mode=TwoWay}">
    <Window.TaskbarItemInfo>
        <TaskbarItemInfo ProgressState="{Binding TaskbarProgressState}" ProgressValue="{Binding TaskbarProgressValue}" />
    </Window.TaskbarItemInfo>
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="bvc"/>
    </Window.Resources>
    <Window.DataContext>
        <vm:DataHelper />
    </Window.DataContext>
    <Grid x:Name="grdMain">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="0"></ColumnDefinition>
            <ColumnDefinition Width=".9*"></ColumnDefinition>
            <ColumnDefinition Width="0"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition MaxHeight="95"/>
            <RowDefinition Height="Auto" />
            <RowDefinition MaxHeight="8"/>
            <RowDefinition MinHeight="200" Height=".8*"/>
        </Grid.RowDefinitions>
        
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="3" Background="#DDDDDD" Orientation="Horizontal">
            <Label x:Name="lblSiteName" Foreground="#222222">
                <Run Text="{Binding Source={x:Static p:Settings.Default}, Path=SiteName, Mode=OneWay, StringFormat='Site Name: \{0\}'}"/>
            </Label>
            
            <Label x:Name="lblSiteCode" Foreground="#222222">
                    <Run Text="{Binding Source={x:Static p:Settings.Default}, Path=SiteCode, Mode=OneWay, StringFormat='Site Code: \{0\}'}"/>
            </Label>
            
            <Label x:Name="lblCulture" Foreground="#222222">
                <Run Text="{Binding Source={x:Static p:Settings.Default}, Path=Language, Mode=OneWay}"/>
            </Label>

            <Label x:Name="lblVersion" Foreground="#222222" HorizontalAlignment="Right" HorizontalContentAlignment="Right">
                
            </Label>
        </StackPanel>

        <StackPanel Grid.Row="1" Grid.Column="1" Margin="8,5,8,0">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="278"></ColumnDefinition>
                    <ColumnDefinition Width="*"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <!--<WebBrowser Grid.Column="0" Grid.ColumnSpan="2" x:Name="browser" Height="112" Width="Auto" DataContext="{Binding}" />-->
                <StackPanel Orientation="Horizontal">
                    <Image x:Name="imageWHO" Width="47" Height="48" Margin="0, 0, 20, 0" Source="Images\WHO_Logo_Small.png" />
                    <Image x:Name="imageCDC" Width="78" Height="48" Margin="0, 0, 20, 0" Source="Images\CDC_Logo_Small.png" />
                </StackPanel>

                <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Visibility="{Binding Source={x:Static p:Settings.Default}, Path=MenafrinetLogoVisibility, Mode=OneWay}">
                    <Image x:Name="imageMenafrinet" Width="120" Height="48" Source="Images\Menafrinet_Logo.png" />
                </StackPanel>
                
                <StackPanel Grid.Row="1" Grid.ColumnSpan="2">
                    <Label x:Name="lblTitle" Foreground="#006699" FontWeight="Light" FontSize="20pt">
                        <!-- FRENCH: Système de la Gestion des Données de la Surveillance au Cas par Cas-->
                        Meningitis Case-Based Surveillance Data Management System
                    </Label>
                </StackPanel>
            </Grid>
        </StackPanel>

        <Grid x:Name="grdMenuItems" Margin="8,10,8,0" Grid.Row="2" Grid.Column="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="6"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="6"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="6"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
                <ColumnDefinition Width="6"></ColumnDefinition>
                <ColumnDefinition Width="*"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"></RowDefinition>
            </Grid.RowDefinitions>

            <!-- Page d'accueil-->
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabHome" AssociatedPage="{Binding ElementName=panelHome}" Grid.Column="0" IsChecked="True" Content="{x:Static p:Resources.TabHome}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />

            <!--Saisie des données -->
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabEntry" AssociatedPage="{Binding ElementName=panelDataEntry}" Grid.Column="2" IsChecked="False" Content="{x:Static p:Resources.TabDataEntry}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabTransmit" AssociatedPage="{Binding ElementName=panelTransmit}" Grid.Column="4" IsChecked="False" Content="{x:Static p:Resources.TabTransmission}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />

            <!-- Fusion -->
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabMerge" AssociatedPage="{Binding ElementName=panelMerge}" Grid.Column="6" IsChecked="False" Content="{x:Static p:Resources.TabMerge}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabStatus" Grid.Column="8" IsChecked="False" Content="Status" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />

            <!--Analyse -->
            <controls:TabButton Style="{StaticResource TabButtonStyle}" x:Name="btnTabAnalysis" AssociatedPage="{Binding ElementName=panelAnalysis}" Grid.Column="10" IsChecked="False" Content="{x:Static p:Resources.TabAnalysis}" Checked="btnTab_Checked" Unchecked="btnTab_Unchecked" />

        </Grid>

        <controls:HomePanel x:Name="panelHome" Grid.Column="1" Grid.Row="4" Visibility="{Binding IsChecked, ElementName=btnTabHome, Converter={StaticResource bvc}}" />
        <controls:DataEntryPanel x:Name="panelDataEntry" Grid.Column="1" Grid.Row="4" Visibility="{Binding IsChecked, ElementName=btnTabEntry, Converter={StaticResource bvc}}" />
        <controls:TransmitPanel x:Name="panelTransmit" Grid.Column="1" Grid.Row="4" Visibility="{Binding IsChecked, ElementName=btnTabTransmit, Converter={StaticResource bvc}}" />
        <controls:MergePanel x:Name="panelMerge" Grid.Column="1" Grid.Row="4" Visibility="{Binding IsChecked, ElementName=btnTabMerge, Converter={StaticResource bvc}}"/>
        <controls:AnalysisPanel x:Name="panelAnalysis" Grid.Column="1" Grid.Row="4" Visibility="{Binding IsChecked, ElementName=btnTabAnalysis, Converter={StaticResource bvc}}" />

    </Grid>
</Window>
